//
//  RoundState.h
//  DiceWar
//
//  Created by xiaofeng on 22/6/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#ifndef CLASSES_GAME_GAMEPLAY_ROUNDSTATE_H_
#define CLASSES_GAME_GAMEPLAY_ROUNDSTATE_H_

class WarLayer;

class IWarLayerState
{
public:
    virtual void onHexCellClicked(int coordinateX, int coordinateY, WarLayer& controller) = 0;
    virtual void onFightingAnimOver(WarLayer& controller) = 0;
};

class WarLayerStateWaitForAttacker: public IWarLayerState
{
public:
    virtual void onHexCellClicked(int coordinateX, int coordinateY, WarLayer& controller);
    virtual void onFightingAnimOver(WarLayer& controller);
};

class WarLayerStateWaitForDefender: public IWarLayerState
{
public:
    virtual void onHexCellClicked(int coordinateX, int coordinateY, WarLayer& controller);
    virtual void onFightingAnimOver(WarLayer& controller);
};

class WarLayerState
{
public:
    WarLayerState();
    ~WarLayerState();
    
    void changeToWaitForAttacker();
    void changeToWaitForDefender();

    void onHexCellClicked(int coordinateX, int coordinateY, WarLayer& controller);
    void onFightingAnimOver(WarLayer& controller);
    
private:
    IWarLayerState* m_pState;
    WarLayerStateWaitForAttacker m_waitForAttackerState;
    WarLayerStateWaitForDefender m_waitForDefenderState;
};

#endif //CLASSES_GAME_GAMEPLAY_ROUNDSTATE_H_
